<div class="maintop">
    当前位置：自动抢发包用户管理
    <a href="javascript:;" action="<?=$basepath?>_add" class="mainFrame button icon-plus">添加用户</a>
    <a href="javascript:;" action="<?=$basepath?>_recharge?<?=$this->page_url($page_current,$page_url)?>" id="btn_refresh" class="mainFrame button">自动充值</a>
    <a href="javascript:;" action="<?=$basepath?>?<?=$this->page_url($page_current,$page_url)?>" id="btn_refresh" class="mainFrame button">刷新</a>
    <? if(ISDEBUG){ ?>
        <a href="javascript:$('.debuginfo').toggle();" class="button">调试信息</a>
        <a href="/cache/update?key=<?=$this->redisPrefix['UAUTOS']?>" class="button" target="ajax" func="loadpage">更新缓存</a>
    <? } ?>
</div>
<div class="main-search">
    <table width="100%">
        <tbody><tr>
            <td>
                <form action="<?=$basepath?>" id="SearchForm" method="get" target="ajax" dataType="html" onajax="beforeSearchForm" call="searchForm" container="#iframe" isLoad="true">
                    <input type="text" id="sKey" name="sKey" class="int" placeholder="搜索关键字">
                    <select name="gameid" id="gameid">
                        <option value="0">游戏类型</option>
                        <?php foreach ($games as $key=>$val){ ?>
                            <option value="<?=$key?>"><?=$val?></option>
                        <?php } ?>
                    </select>
                    每页：
                    <select id="ps" name="ps">
                        <option value="12" <?php if($this->existsKeyInArray('ps',$searchdata,'N',$this->pagesize) == 12) echo 'selected';?> >12</option>
                        <option value="20" <?php if($this->existsKeyInArray('ps',$searchdata,'N',$this->pagesize) == 20) echo 'selected';?> >20</option>
                        <option value="30" <?php if($this->existsKeyInArray('ps',$searchdata,'N',$this->pagesize) == 30) echo 'selected';?> >30</option>
                        <option value="50" <?php if($this->existsKeyInArray('ps',$searchdata,'N',$this->pagesize) == 50) echo 'selected';?> >50</option>
                        <option value="100" <?php if($this->existsKeyInArray('ps',$searchdata,'N',$this->pagesize) == 100) echo 'selected';?> >100</option>
                    </select>
                    <input type="submit" value="搜索" class="upbutton">
                    <input action="<?=$basepath?>_delete_list" type="button" id="deleteSelectId" value="删除选择" class="upbutton">
                </form>
            </td>
        </tr>
        </tbody>

    </table>
</div>
<div id="mainbody">
    <table width="100%" class="tablist">
        <tr class="trbg"><th width="30"><input id="selectAllid" type="checkbox" value="1" /></th>
            <th>No.</th>
			<th>充</th>
			<th>玩家号码</th>
            <th>玩家昵称</th>
            <th>玩家类型</th>
            <th>对应游戏</th>
            <th>帐户余额</th>
            <th>参与金额</th>
            <th>注册时间</th>
            <th width="60">操作</th>
        </tr>
        <? foreach($datas as $v){ ?>
            <tr<?=($v['isdelete']?' class="delete"':'')?>>
                <td width="30"><input type="checkbox" name="selectValue" value="<?=$v['uid']?>" /></td>
                <td><a href="javascript:;" action="/box/mail_add_pop?touid=<?=$v['uid']?>" class="mainFrame" title="发送站内信"><?=$v['uid']?></a></td>
				<td width="20"><a href="/members/rechargetouser?uno=<?=$v['uno']?>" class="button fa fa-cny" target="ajax" func="loadpage" title="给玩家充值"></a></td>
                <td><a href="javascript:;" action="/box/mail_push_pop?uno=<?=$v['uno']?>&nickname=<?=$v['nickname']?>" class="mainFrame" title="推送信息"><?=$v['uno']?></a></td>
                <td><?=$v['nickname']?></td>
                <td><?=$this->usertype[$v['usertype']]?></td>
                <td><?=$games[$v['gameid']]?></td>
                <td><?=$v['coin']?></td>
                <td><?=$v['betcoin']?></td>
                <td><?=$this->formatTimes($v['regtimes'])?></td>
                <td>
                    <? if($v['isdelete']){ ?>
                        <a action="<?=$basepath?>_recovery?uid=<?=$v['uid']?>" title="恢复" class="mainFrame button icon-undo" href="javascript:;"></a>
                    <? }else{ ?>
                    <a action="<?=$basepath?>_delete?uid=<?=$v['uid']?>" title="删除" class="mainFrame button icon-trash-2" href="javascript:;"></a>
                    <? } ?>
                    <a href="/members/members_list_edit?uid=<?=$v['uid']?>" title="编辑 - <?=$v['nickname']?>" class="colorbox button icon-edit"></a>
                </td>
            </tr>
        <? } ?>
    </table>
    <? require VIEW.'/page.view.php' ?>
</div>
<script type="text/javascript">
    function beforeSearchForm(){

    }
    function searchForm(self, _html, data){
        $("#iframe").html(_html);
    }
    $(document).ready(function(){
        <?php
        if(!empty($searchdata['gameid'])){
            echo '$("#gameid option[value='.$searchdata['gameid'].']").attr("selected", "selected");';
        }
        if(!empty($searchdata['sKey'])){
            echo '$("#sKey").val("'.$searchdata['sKey'].'");';
        }
        ?>
        $(".colorbox").colorbox({ iframe: true,width:"80%",height:"80%" });
    });
</script>
